<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        for (let i = 100; i <= 999; i++) {
            // 百位
            let x = Math.floor(i / 100);
            //十位
            let y = (Math.floor(i / 10)) % 10;
            // 个位
            let z = i % 10;
            let narcissus = Math.pow(x, 3) + Math.pow(y, 3) + Math.pow(z, 3);
            if (narcissus == 100 * x + 10 * y + z) {
                console.log(narcissus);
            }
        }
    </script>
</body>

</html>